package com.oa.co.controller;

import com.github.pagehelper.PageInfo;
import com.oa.co.common.PageVo;
import com.oa.co.pojo.Printer;
import com.oa.co.service.PrinterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/printer")
public class PrinterController {

    @Autowired
    private PrinterService printerService;

    @RequestMapping("/selectPrinter")
    public PageVo<Printer> selectPrinter(Integer page,Integer limit,Integer printer_id) {
        PageVo<Printer> printerPageVo = new PageVo<>();

        PageInfo<Printer> pageInfo = printerService.getPageData( page, limit, printer_id);

        printerPageVo.setData(pageInfo.getList());
        printerPageVo.setCode(0);
        printerPageVo.setCount(pageInfo.getTotal());
        printerPageVo.setMsg("分页信息");

        return printerPageVo;
    }

}
